#include <stdio.h>
#include <stdlib.h>

//https://www.nowcoder.com/practice/b8e6a46992fe4e11b2822b20561b6d94?tpId=290&tqId=618631&ru=/exam/oj/ta&qru=/ta/beginner-programmers/question-ranking&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D290

typedef struct ARR {
    int n;
    int Arr[0];
}ARR;

int main() {
    int row = 0;
    int col = 0;
    int Irow = 0;
    int Icol = 0;
    scanf("%d%d", &row, &col);
    ARR *arr = (ARR *) malloc(sizeof(ARR) + row * col * sizeof(int));
    if (!arr) {
        perror("堆区开辟内存失败:");
    }
    arr->n = row * col;
    for (int i = 0; i < arr->n; i++) {
        scanf("%d", arr->Arr + i);
    }
    scanf("%d%d", &Irow, &Icol);
    printf("%d", *(arr->Arr + (Irow - 1) * col + Icol - 1));
    free(arr);
    arr = NULL;
    return 0;
}